package com.nancy.java_design.observer.demo2;

/**
 * 警察抓小偷
 */
public class Client {
    public static void main(String[] args) {
        // 警察
        Police police = new Police("警察王闯");
        // 小偷
        Thief thief = new Thief("小偷李四");
        // 警察观察小偷
        thief.addObserver(police);
        // 小偷偷东西
        thief.steal();
    }

}
